/* 
描述：CommentServiceImpl类实现了CommentService接口，提供评论相关的业务逻辑实现，
包括评论的增删改查操作，是问答社区评论功能的核心服务类。
完成人：吴悠 
完成时间: 2025/04/27
*/
package com.jiesenhe.qacommunity.service.impl;

import com.jiesenhe.qacommunity.mapper.CommentMapper;
import com.jiesenhe.qacommunity.pojo.Comment;
import com.jiesenhe.qacommunity.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    @Override
    public int insertComment(Comment comment) {
        return commentMapper.insertComment(comment);
    }

    @Override
    public int deleteComment(Comment comment) {
        return commentMapper.deleteComment(comment);
    }

    @Override
    public int deleteCommentLike(int commentId) {
        return commentMapper.deleteCommentLike(commentId);
    }

    @Override
    public List<Comment> getComment(int userId) {
        return commentMapper.getComment(userId);
    }
}
